#include "ProcessPool.hpp"
#include "Task.hpp"
int main(int argc, char *argv[])
{
    if (argc != 2)
    {
        std::cout << "Usage: " << argv[0] << "process-num" << std::endl;
        return INPUTERROR;
    }
    int num = std::stoi(argv[1]);
    std::vector<channel> channels;
    processpool *pr = new processpool(num,worker);

    // 2.初始化进程池
    pr->InitProcessPool();
    // 派发任务
    pr->DispatchTask();
    // 退出进程池
    pr->ExitProcess();
    // DebugPrint(channels);
    // sleep(100);
    return 0;
}